package dk.itu.cloudcomputing.hackystat.controller;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/**
 *
 */
public class HostProvider {

    private static List<String> hosts = null;

    public synchronized String getNextHost() {
        String res = hosts.remove(0);
        hosts.add(res);
        return res;
    }

    public void setHosts(String... host) {
        HostProvider.hosts = new ArrayList<String>(Arrays.asList(host));
    }

    public void setHosts(List<String> hosts) {
        HostProvider.hosts = new ArrayList<String>(hosts);
    }
}
